<include file="Public:header" />
<div class="container">
  <div class="mainbody"> <include file="Public:scoreMenu" />
    <div class="rig_lm03">
      <div class="title" ><img src="{$Think.config.static_path}images/listicon.jpg" class="icon" >
        <h2>{$title}--订单列表</h2>
        <form method="POST" action="" style="margin-left:100px;">
		
            <input type="text" name="start_time" style="width:150px;" class="searcheTxt" id="sttime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" placeholder="开始时间"  value="<?php echo $_REQUEST['stime']?>">
			 <input type="text" name="start_time" style="width:150px;" class="searcheTxt" id="edtime" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" placeholder="结束时间"  value="<?php echo $_REQUEST['etime']?>">
          <input type="text"  class="searcheTxt"  style="width:200px;" placeholder="请输入订单号" name="keys" id="keys" value="<?php echo $_REQUEST['keys']?>">
          <button type="button" onclick="changeSelect(1)" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span> 搜索</button>
        </form>
       <p class="text-right function"> <a title="导出订单列表" class="btn btn-success" href="javascript:changeSelect(2);"><span class="glyphicon glyphicon-export"></span>导出</a>
            <input type="hidden" name="teamArr" id="teamArr" />
          </p>
      </div>
      <div class="detail">
        <div id="tabCot_product_1" class="tabCot" >
          <table cellspacing="0" cellpadding="0" width="100%" border="0" class="tabindex table-hover">
            <tbody>
              <tr>
			    
                <th>订单ID</th>
                <th>订单二维码创建人</th>
                <th>购买商品</th>
                <th>用户名</th>
                <th>电话</th>
                <th>支付价格</th>
                <th>支付积分</th>
                <th>状态</th>
                <th>订单时间</th>
                
              </tr>
              <volist name="list" id="vo" key="key">
                <tr>
                  <td>{$vo.id}</td>
                  <td>{:getQrcodeByUid($vo['uid'])}</td>
                  <td>{$vo.title} </td>
                  <td>{$vo.huiyuanname}</td>
                  <td>{$vo.huiyuantel}</td>
                  <td>{$vo.price}</td>
                  <td>{$vo.score}</td>
                  <td><if condition="$vo.status eq 1">未支付<elseif condition="$vo.status eq 2"/>已支付<else/>已取消</if></td>
                  <td>{$vo.ctime}</td>
                </tr>
              </volist>
            </tbody>
          </table>
          <div class="manu"> {$page} </div>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" /> 
<script type="text/javascript">
$(function(){
	$('#sorder').addClass('rig_seleli');
	$("tr:odd").addClass("even");
	$("tr:even").addClass("odd");
	});
function changeSelect(key) {
    var st = $("#sttime").val();
	var ed = $("#edtime").val();
	var keys = $('#keys').val();
	if(st<=ed){
		if(key==1){
			location.href = "__URL__/orderList?keys=" + keys+"&stime="+st+"&etime="+ed +"&id=<?php echo $_GET['id']?>";
		}else{
			location.href="__URL__/exportData?keys=" + keys+"&stime="+st+"&etime="+ed +"&id=<?php echo $_GET['id']?>";
		}
	}else{
		alert('结束时间不能小于开始时间');
	}
    
}


function confirmDelete(id){
if (confirm("确认要删除这条数据吗？")) {
       location.href="__URL__/delUser?id="+id+"&activityId=<?php echo $_GET['id']?>";
     }
}




function setUserOrder(id){
	var gorder = $('#gorder_'+id).val();
	$.ajax({

             type: "GET",

             url: "__URL__/setUserOrder?id="+id+"&gorder="+gorder,

             data: '',

             dataType: "json",

             success: function(data){
				location.replace(location.href);
                  }
		
         });
}

</script>